#ifndef W_PUSHBUTTON_H
#define W_PUSHBUTTON_H

//
// 作者：AKA_GGbond
// 时间：2025/07/24
// 邮箱：evain_wl@163.com
//

#include <QWidget>
#include "stdafx.h"

class W_PushButtonPrivate;
class W_PushButton : public QWidget
{
    Q_OBJECT
    Q_Q_CREATE(W_PushButton)
    Q_PROPERTY_CREATE_Q_H(int, BorderRadius)
    Q_PROPERTY_CREATE_Q_H(QColor, DefaultColor)
    Q_PROPERTY_CREATE_Q_H(QColor, HoverColor)
    Q_PROPERTY_CREATE_Q_H(QColor, PressColor)
    Q_PROPERTY_CREATE_Q_H(QColor, TextColor)

public:
    explicit W_PushButton(QWidget *parent = nullptr);
    ~W_PushButton();

protected:
    virtual void mousePressEvent(QMouseEvent* event) override;
    virtual void mouseReleaseEvent(QMouseEvent* event) override;
    virtual void paintEvent(QPaintEvent* event) override;
    virtual bool event(QEvent* event) override;

private:
    void drawEffectShadow(QPainter* painter, QRect widgetRect, int shadowBorderWidth, int borderRadius);
};

#endif // W_PUSHBUTTON_H
